﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ebMS3dotnet.Core.Configuration
{
    [ConfigurationCollection(typeof(FilterElement), AddItemName = "processor")]
    class ProcessorElementCollection:ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new ProcessorElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            if(element == null)
                throw new ArgumentNullException("element");
            ProcessorElement processorElement = (ProcessorElement)element;
            return processorElement.FilterName + ":" + processorElement.ProcessorType;
        }
    }
}
